<?php

namespace app\admin\model\app;

use think\Model;

/**
 * Authorization
 */
class Authorization extends Model
{
    // 表名
    protected $name = 'app_authorization';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 字段类型转换
    protected $type = [
        'lasttime' => 'timestamp:Y-m-d H:i:s',
    ];


    public function adminidTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\Admin::class, 'adminid', 'id');
    }

    public function appidTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\app\App::class, 'appid', 'id');
    }
}